#include "clock.h"

Clock::Clock()
{
}

time_point Clock::now(){
    return std::chrono::high_resolution_clock::now();
}

uint64 Clock::toMilli(chrono::high_resolution_clock::duration duration) {
    return chrono::duration_cast<std::chrono::milliseconds>(duration).count();
}

uint64 Clock::toMicro(chrono::high_resolution_clock::duration duration) {
    return chrono::duration_cast<std::chrono::microseconds>(duration).count();
}

uint64 Clock::toNano(chrono::high_resolution_clock::duration duration) {
    return chrono::duration_cast<std::chrono::nanoseconds>(duration).count();
}

uint64 Clock::durationMilli(time_point start, time_point finish)
{
    return std::chrono::duration_cast<std::chrono::milliseconds>(finish - start).count();
}

uint64 Clock::durationMicro(time_point start, time_point finish)
{
    return std::chrono::duration_cast<std::chrono::microseconds>(finish - start).count();
}

uint64 Clock::durationNano(time_point start, time_point finish)
{
    return std::chrono::duration_cast<std::chrono::nanoseconds>(finish - start).count();
}
